=== WD Customer Product Notification for WooCommerce ===
Contributors: wdonlinedk
Donate link: https://paypal.me/wdonlinedk
Tags: woocommerce, product notification, product update, customer request
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
Requires Plugins: woocommerce
Stable tag: 1.1.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Lets visitors request a product update and optionally receive an email when the product featured image is later added or changed.

== Description ==

WD Customer Product Notification for WooCommerce displays product update controls on products in a selected WooCommerce product category.

A visitor can first click a request button. This sends an administrator notification containing the product name, product URL, product ID, and timestamp. A long-lived browser cookie prevents the same browser from sending another administrator request for the same product.

The visitor can also optionally enter an email address to receive a one-time customer notification. The address is stored on the product until its featured image is later added or changed. After a successful customer email is sent, that address is removed from the waiting list.

Features:

* Configurable administrator notification recipient email address.
* Configurable sender name and sender email for all emails sent by the plugin.
* Product category selection using a WooCommerce category dropdown.
* English default interface with translation-ready strings.
* Default frontend texts are visible directly in the settings fields.
* Configurable request-button and customer-email text.
* Configurable customer email subject and message with product placeholders.
* Backend styling controls for buttons, email input field, and confirmation messages.
* One administrator notification per browser per product using a cookie.
* Optional one-time customer email when the featured image is later added or changed.
* Duplicate customer email addresses are prevented per product.
* Nonce protection, capability checks, sanitization, and escaping.
* Settings page under the shared WD Online admin menu.
* WooCommerce HPOS compatibility declaration.

== Installation ==

1. Upload the plugin ZIP file through Plugins > Add New > Upload Plugin.
2. Activate the plugin.
3. Go to WD Online > Customer Product Notification.
4. Select the product category and set the administrator notification recipient.
5. Set the sender name and sender email used for plugin emails.
6. Adjust frontend text, customer email text, and styling if needed.

== Frequently Asked Questions ==

= Which products show the notification controls? =

By default, products in the category with the slug `usorterede`. The category can be selected from the WooCommerce product-category dropdown in the plugin settings.

= How is a duplicate administrator notification prevented? =

The plugin stores a browser cookie for the specific product after an administrator notification email is successfully sent. The cookie expires after ten years.

= When is the customer notification email sent? =

A registered customer email address is notified once when the product featured image is later added or changed. Successfully notified addresses are removed from the product waiting list.

= Can the customer email be customized? =

Yes. The subject and message can be changed in the plugin settings. The placeholders `{product_name}`, `{product_url}`, and `{product_id}` are supported.

= Can the plugin be translated? =

Yes. All plugin interface strings use WordPress translation functions and the text domain `wd-customer-product-notification`.

== Changelog ==

= 1.1.2 =
* Removed the discouraged manual load_plugin_textdomain() call.
* Added routing nonce verification before processing frontend POST data.
* Added nonce-protected frontend status query parameters.
* Resolved the Plugin Check warnings reported for version 1.1.1.
* Preserved existing functionality and settings.

= 1.1.1 =
* Added configurable sender name and sender email settings.
* Applied the configured sender to both administrator notifications and customer update emails.
* Preserved existing settings and behavior from version 1.1.0.

= 1.1.0 =
* Filled text settings with visible translated default values instead of blank fields.
* Replaced the product category slug text field with a WooCommerce product-category selector.
* Removed the visitor IP address from administrator notification emails.
* Added optional customer email signup on supported product pages.
* Added one-time customer notification when the featured image is later added or changed.
* Added duplicate email prevention per product.
* Added configurable customer email subject and message with placeholders.
* Added styling options for the customer email input field.
* Added nonce validation and sanitization for customer email signup.

= 1.0.0 =
* Initial WD Online release.
* Added configurable notification recipient.
* Added configurable product category slug.
* Added translation-ready frontend and backend strings.
* Added frontend text overrides.
* Added button and message styling controls.
* Added nonce validation, sanitization, escaping, and secure request handling.
* Added WooCommerce HPOS compatibility declaration.

== Privacy ==

The plugin stores a product-specific browser cookie for up to ten years after a visitor sends an administrator product-update request. This is used to prevent duplicate requests from the same browser.

If a visitor chooses to receive a customer email notification, the submitted email address is stored as product metadata until the product featured image is later added or changed and the notification is successfully sent. The email address is then removed from the waiting list. Site owners should document this behavior in their privacy/cookie information where required.
